<template>
  <div class="dashboard-container">
    <city-picker :row-sele-result= "arr" style="margin-left:20px" @selectCityResult="selectCityResult"/>
  </div>
</template>

<script>
import cityPicker from '@/components/City/cityCheck'
export default {
  name: 'Cascade',
  components: {
    cityPicker
  },
  data() {
    return {
      arr: [], // 省市区三级联动内容
      city: '', // 市
      province: '', // 省
      district: '', // 区
      pickCity: [] // 数据
    }
  },
  methods: {
    // 地址选择三级联动选择的内容
    selectCityResult(data) {
      if (data.areaLevel === 2) { // 省
        this.city = ''
        this.district = ''
        this.province = data
      } else if (data.areaLevel === 3) { // 市
        this.city = data
        this.district = ''
      } else { // 区
        this.district = data
      }
    }
  }
}
</script>

<style scoped>
.dashboard-container {
  background-color: #fff;
  padding: 30px 20px 20px 20px;
  height: 80vh;
}
</style>
